import {
  Component,
  EventEmitter, Output
} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {
  type InvestmentInput
} from '../investment-input';
import {
  InvestmentService
} from '../investment.service';

@Component({
  selector: 'app-user-input',
  imports: [
    FormsModule
  ],
  templateUrl: './user-input.html',
  styleUrl: './user-input.css'
})
export class UserInput {

  enteredInitialInvestment = '0';
  enteredAnnualInvestment='0';
  enteredExpectedReturn = '5'
  enteredDuration = '10';

  constructor(private investmentService:InvestmentService) {

  }

  onSubmit(){
    this.investmentService.calculateInvestmentResults({
      initialInvestment:+this.enteredInitialInvestment,
      duration:+this.enteredDuration,
      expectedReturn:+this.enteredExpectedReturn,
      annualInvestment:+this.enteredAnnualInvestment
    });




  }
}
